﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class wf_act_mail_Map : ClassMapping<wf_act_mail>
    {
        public wf_act_mail_Map()
        {
            //映射ID
            Id(x => x.r_id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            Property(x => x.mail_doflag);

            //所属邮件
            ManyToOne(x => x.mail, map =>
            {
                map.Column(wf_act_mail.Columns.mail_id);
            });

            //所属执行用户
            ManyToOne(x => x.douser, map =>
            {
                map.Column(wf_act_mail.Columns.douser_id);
                map.NotNullable(false);
            });

            Table(wf_act_mail.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
